package org.order.server.controller;

import org.common.server.base.vo.ResponseData;
import org.order.server.entity.vo.SysOrderVo;
import org.order.server.service.GoodService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {

    @Resource
    private GoodService goodService;

    @GetMapping("/order/detail/{code}")
    public ResponseData queryOrder(@PathVariable String code) {
        SysOrderVo vo = new SysOrderVo();
        vo.setCode(code);
        String goodInfo = goodService.queryGood(code);
        vo.setGoodInfo(goodInfo);
        return ResponseData.success(vo);
    }
}


